<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>遍历对象</title>
</head>
<body>

</body>
<script>
     var emp = {
         id:1, // 不出现在页面上
         name:'Mary',
         gender:'female',
         dept:{
             name:'HR',
             desc:''
         }
     }

     for (var key in emp){
         alert(key);
     }

</script>
</html>